package com.tf_cut.backend.payment.dao;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import com.tf_cut.backend.payment.pojo.ConfigSetting;

public interface SellerConfigRepository extends JpaRepository<ConfigSetting, String> {

	@Query(value ="SELECT max( c.config_name ) FROM config_setting c  WHERE c.config_type = 'invoice_service_type' and LENGTH(c.config_name) = (select max(CHAR_LENGTH (config_name)) from config_setting WHERE config_type = 'invoice_service_type')", nativeQuery = true)
	Integer findByCount();

	@Query(value ="select c.* from config_setting c where c.config_name=?1 and c.config_type = 'invoice_service_type'", nativeQuery = true)
	ConfigSetting findByName(String id);

	
	

}
